package com.itmayiedu.api.service.impl;

import com.itmayiedu.api.order.OrderService;
import com.itmayiedu.base.BaseApiService;
import com.itmayiedu.base.ResponseBase;
import com.itmayiedu.dao.OrderDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * @Author cht 【wonderfor@vip.qq.com】
 * @Date 2018/11/7
 */
@RestController
public class OrderServiceImpl extends BaseApiService implements OrderService {

    @Autowired
    private OrderDao orderDao;

    @Override
    public ResponseBase updateOrder(@RequestParam("isPay") Long isPay,@RequestParam("payId") String aliPayId,@RequestParam("orderNumber") String orderNumber) {
        int updateOrder = orderDao.updateOrder(isPay, aliPayId, orderNumber);
        if(updateOrder <= 0) {
            return setResultError("系统错误!");
        }
        return setResultSuccess();
    }
}
